package nc.tb.schema;

public class MemoryPKGenerator {
	 int ii=1;
	 private static MemoryPKGenerator m_Instance;
	public static MemoryPKGenerator getInstance(){
		if(m_Instance==null)
			m_Instance=new MemoryPKGenerator();
		return m_Instance;
	}
	public String genPK(String schemaCode){
		String s=ii+"";
		int nLen=s.length();
		int nZeros=20-8-nLen;
		StringBuffer sb=new StringBuffer();
		for (int i = 0; i < nZeros; i++) {
			sb.append("0");
		}
		String sPK="TBS"+schemaCode+"_"+sb.toString()+ii;
		ii++;
		return sPK;
	}
}
